package org.pulloid;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

class ParserFactory {
	
	private static XmlPullParserFactory factory;
	
	static XmlPullParser newParser() throws XmlPullParserException {
		synchronized(ParserFactory.class) {
			if(factory == null) {
				initFactory();
			}
			return factory.newPullParser();
		}
	}
	
	private static void initFactory() throws XmlPullParserException {
		factory = XmlPullParserFactory.newInstance();
		factory.setNamespaceAware(false);
		factory.setValidating(false);
	}

}
